package com.mall.user.dto;

import com.mall.commons.result.AbstractRequest;
import com.mall.commons.tool.exception.ValidateException;
import com.mall.user.constants.SysRetCodeConstants;
import lombok.Data;

/**
 * @program: cs-mall_35th
 * @description:
 * @author: Weiwei Liu
 * @create: 2021-12-12 15:14
 **/
@Data
public class VerifyMemberRequest extends AbstractRequest {

    private String username;
    private String email;
    private String isVerify;

    @Override
    public void requestCheck() {

        if (username == null && email == null) {

            //  至少要有一个作为查询更新依据
            throw new ValidateException(
                    SysRetCodeConstants.REQUISITE_PARAMETER_NOT_EXIST.getCode(),
                    SysRetCodeConstants.REQUISITE_PARAMETER_NOT_EXIST.getMessage());
        }
    }
}
